import React from "react";
import { View, Image ,Text} from "@tarojs/components";




import IconBack from '@/assets/images/icon-back.png'
import './index.scss'
import useInitAction from "@/hooks/useInitAction";
const FullBar:React.FC<{
    navName: string,
    showReturn?:boolean
    handleGoBack?:()=>void
}>=({navName,showReturn,handleGoBack})=>{
   
    const {placeHolderHeight,barTop} = useInitAction()

   
  
   
    return(
        <>
        {placeHolderHeight > 0&&  <View className="fullbar" style={{ height: placeHolderHeight, paddingTop: barTop }}>
       {showReturn&& <Image src={IconBack} className="fullbar-icon" onClick={handleGoBack}></Image>}
        <Text>{navName}</Text>
        
    </View>}
        </>
      
    )
}
export default FullBar